﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace HCDV.DB
{
    public interface Idb
    {
        /// <summary>
        /// 获取主键
        /// </summary>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        long GetSequence(string fieldName);
        /// <summary>
        /// 执行指定的prc
        /// </summary>
        /// <param name="procname"></param>
        /// <param name="allinfo"></param>
        /// <param name="info"></param>
        /// <returns></returns>
        bool doProc(string procname, Hashtable allinfo, out string info);
        DataSet getProc(string procname, Hashtable allinfo);
        /// <summary>
        /// 执行SQL
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        int spExe(string sql);
        /// <summary>
        /// 查询SQL
        /// </summary>
        /// <param name="SQLString"></param>
        /// <returns></returns>
        DataTable query(string SQLString);
        DataSet queryds(string SQLString);
        /// <summary>
        /// 通用查询-分页
        /// </summary>
        /// <param name="tableinfo"></param>
        /// <param name="returnfiles"></param>
        /// <param name="startp"></param>
        /// <param name="endp"></param>
        /// <param name="where"></param>
        /// <param name="pall"></param>
        /// <param name="orders"></param>
        /// <returns></returns>
        DataTable getPageInfo(string tableinfo, string returnfiles, string startp, string endp, string where, ref int pall, string orders = null);
        DataTable getPage(string tableinfo, string returnfiles, string startp, string endp, string where, ref double pall, string orders = null);
        

       
        /// <summary>
        /// 通用查询-不分页
        /// </summary>
        /// <param name="tableinfo"></param>
        /// <param name="returnfiles"></param>
        /// <param name="orders"></param>
        /// <returns></returns>
        DataTable getInfo(string tableinfo, string returnfiles, string where, string orders = null);
        
        
        /// <summary>
        /// 工作流查询
        /// </summary>
        /// <param name="tableinfo"></param>
        /// <param name="returnfiles"></param>
        /// <param name="where"></param>
        /// <param name="orders"></param>
        /// <returns></returns>
        DataTable getInfohf( LoginUser l ,string ywcode,string tableinfo, string returnfiles, string where, string orders = null);
        /// <summary>
        /// 工作流查询
        /// </summary>
        DataTable getPageInfohf( LoginUser l ,string ywcode,string tableinfo, string returnfiles, string startp, string endp, string where, out int pall, string orders = null);
        /// <summary>
        /// 工作流查询
        /// </summary>
        DataTable getPagehf( LoginUser l ,string ywcode,string tableinfo, string returnfiles, string startp, string endp, string where, out double pall, string orders = null);


        /// <summary>
        /// 插入并返回自增ID
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        double spExeBackid(string sql);
    }
}
